package cn.iocoder.yudao.module.forward.dal.mysql.datasourceregisterconfig;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.forward.dal.dataobject.datasourceregisterconfig.DataSourceRegisterConfigDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.forward.controller.admin.datasourceregisterconfig.vo.*;

/**
 * 信息源注册配置信息 Mapper
 *
 * @author dfs
 */
@Mapper
public interface DataSourceRegisterConfigMapper extends BaseMapperX<DataSourceRegisterConfigDO> {

    default PageResult<DataSourceRegisterConfigDO> selectPage(DataSourceRegisterConfigPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DataSourceRegisterConfigDO>()
                .eqIfPresent(DataSourceRegisterConfigDO::getAddress, reqVO.getAddress())
                .eqIfPresent(DataSourceRegisterConfigDO::getLicense, reqVO.getLicense())
                .eqIfPresent(DataSourceRegisterConfigDO::getOwner, reqVO.getOwner())
                .eqIfPresent(DataSourceRegisterConfigDO::getType, reqVO.getType())
                .eqIfPresent(DataSourceRegisterConfigDO::getScope, reqVO.getScope())
                .eqIfPresent(DataSourceRegisterConfigDO::getSourceId, reqVO.getSourceId())
                .betweenIfPresent(DataSourceRegisterConfigDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DataSourceRegisterConfigDO::getId));
    }

}